package com.crh.mapper;

import com.crh.bean.Users;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.SelectProvider;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface TestMapper {

    @SelectProvider(type=TestMapperSql.class, method = "selectAllUsers")
    @Results(
            id = "usersResult",
            value = {
                    @Result(property = "userId", column = "USERID")
            }
    )
    List<Users> selectAllUsers();

    @SelectProvider(type=TestMapperSql.class, method = "selectUsersByCondition")
    @ResultMap("usersResult")
    List<Users> selectUsersByCondition(Users users);
}
